package com.founder.chd_daily_query.controller;

import com.founder.chd_daily_query.entity.query.ConfigPowerStationAreaEntity;
import com.founder.chd_daily_query.service.PowerPlantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/query")
public class PowerPlantController {

    @Autowired
    private PowerPlantService powerPlantService;

    @GetMapping("/powerPlant")
    public List<ConfigPowerStationAreaEntity> powerPlant(@Nullable String area){
        return powerPlantService.powerPlant(area);

    }

    @GetMapping("/area")
    public List area(){
        return powerPlantService.area();
    }

    @GetMapping("/priorityQuery/{power}")
    public List priorityQuery(@PathVariable("power") String power){
        return powerPlantService.priorityQuery(power);
    }


    @GetMapping("/queryPercentage/{power}")
    public Map queryPercentage(@PathVariable("power") String power){
        return  powerPlantService.queryPercentage(power);
    }

}
